import request from '@/api/myRequest'

function findRolesByPage(start, limit) {
  return request({
    url: `/admin/sysAuth/role/findRolesByPage/${start}/${limit}`,
    method: 'get'
  })
}

// 查询所有角色
function findAllRoles() {
  return request({
    url: '/admin/sysAuth/role/findAllRoles',
    method: 'get'
  })
}
// 新增角色
function saveRolePermissions(data) {
  return request({
    url: '/admin/sysAuth/role/saveRolePermissions',
    method: 'post',
    data
  })
}
// 角色详细
function findRolePermissions(id) {
  return request({
    url: `/admin/sysAuth/role/findRolePermissions/${id}`,
    method: 'get'
  })
}
// 修改角色
function updateRolePermissions(data) {
  return request({
    url: '/admin/sysAuth/role/updateRolePermissions',
    method: 'put',
    data
  })
}
// 删除角色
function removeRole(id) {
  return request({
    url: `/admin/sysAuth/role/removeRole/${id}`,
    method: 'delete'
  })
}
export { findRolesByPage, findAllRoles, saveRolePermissions, findRolePermissions, updateRolePermissions, removeRole }
